import { App } from "vue";
import { useUserState } from "@/store/user"; 

export function regPermisstion(app:App<Element>){
    app.directive('permisstion',{
        // 狗子函数
        mounted(el,binding){
            // 实例化仓库
            const userState=useUserState()
            console.log('自定义指令',el,binding)
            // 判断自定义指令绑定的数据是否在仓库的数组里面
            if(!userState.getPermitions?.includes(binding.value)){
                el.remove();
            }
        }
    })
}